package com.yh.dp.principle.lsp;

/**
 * @ClassName Soldier
 * @Description 士兵类
 * @Author 0715-YuHao
 * @Date 2021/1/3 14:58
 */
public class Soldier {

    private AbstractGun gun;

    public AbstractGun getGun() {
        return gun;
    }

    public void setGun(AbstractGun gun) {
        this.gun = gun;
    }

    public void killEnemy() {
        System.out.println("士兵杀敌：");
        gun.shoot();
    }
}
